package com.ruoyi.camp.api;

import com.ruoyi.camp.domain.CBanner;
import com.ruoyi.camp.service.ICBannerService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/wechat/banner")
public class WxBannerController extends BaseController
{
    @Autowired
    private ICBannerService icbannerService;
    /**
     * 查询广告列表
     */
    @GetMapping("/list")
    public TableDataInfo list(CBanner cBanner)
    {
        startPage();
        List<CBanner> list = icbannerService.selectCBannerList(cBanner);
        return getDataTable(list);
    }
    /**
     * 获取广告详细信息
     */
    @GetMapping(value = "/{bannerid}")
    public AjaxResult getInfo(@PathVariable("bannerid") Long bannerid)
    {
        return success(icbannerService.selectCBannerByBannerid(bannerid));
    }

}